<template>
	<view class="container">
		<view class="header align-center justify-between plr14 ft16">
			<view class="align-center searchbox justify-between">
				<uv-input placeholder="请输入课程名称查询" border="none" placeholder-style="color:#fff"></uv-input>
				<uv-icon name="search" size="30" color="#fff"></uv-icon>
			</view>


		</view>
	<!-- 	<view style="height: 110rpx;">

		</view> -->
		<view class="moduletitle bgWhite align-center justify-between plr15 mt10">
			<text></text>
			<view class="ft16 flex1 " style="text-align: center;">
				培训分类
			</view>
			<view class="align-center pickerbox justify-between plr12" @click="showPicker">
				<view class="">
					{{cateName||'请选择培训分类'}}
				</view>
				<uv-icon name="arrow-down" color="#969696"></uv-icon>
			</view>
		</view>
		

		<view class="plr15">
			<view class="pxList flex-wrap justify-between">
				<view class="bgWhite posRelative plr10 ptb10 pxitem  justify-between" v-for="i in infoList " :key="i.id" @click="toMain(i)">
					<image src="/static/images/img_internet.png" mode=""></image>
					<view class="flex1 flex-col justify-between">
						<view class="clamp2 title">
							<text class="tag">收费</text> {{i.title}}
						</view>
						<view class="start radius5 mt5">
							报名开始:{{i.starttime}}
						</view>
						<view class="end radius5 mt5">
							报名截至:{{i.endtime}}
						</view>
						<view class="align-center justify-between">
							<view class="align-center">
								<uv-icon name="clock-fill" color="#0082DB" size="14"></uv-icon> <text class="ml5"> 学时:88
								</text>
							</view> <text style="font-weight: bold;">￥999</text>
						</view>

					</view>
					<view class="allPeo posAbsort">
						全员
					</view>
				</view>
			</view>
		</view>
		<view class="" style="height: 100rpx;">
			
		</view>
		<uv-picker ref="picker" :columns="cateColumn"  keyName="name" @confirm="confirm"></uv-picker>
		<uv-picker ref="picker1" :columns="columns" @confirm="confirm1"></uv-picker>
		<uv-picker ref="picker2" :columns="columns" @confirm="confirm2"></uv-picker>
		<customTab :active="0"></customTab>
		<view class="backOrSave boxshadow20 mt15">
			<view class="back-box">
				<view class="info-box">
					上一页
				</view>
			</view>
			<view class="save-box">
				<view class="info-box">
					下一页
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import customTab from '../../components/customTab.vue';
	let app = getApp();
	export default {
		components: {
			customTab
		},
		data() {
			return {
				columns: [
					[]
				],
				hangyelist:[
					
				],
				cateList:[
					
				],
				infoList:[],
				cateName:"",
				active:0
			}
		},
		onLoad(opt) {
			this.$api.getHangYe().then(res=>{
				console.log(res)
				this.hangyelist=res.data
			})
			this.$api.getCate().then(res=>{
				
				this.cateList=res.data
				
			})
			this.$api.getLeiXing().then(res=>{
				console.log(res)
			})
			this.init()
		},
			
		computed: {
				cateColumn() {
					return [this.cateList];
				}
			},
		mounted() {},
		methods: {
			init(){
					this.$api.getInfo().then(res=>{
						console.log(res)
						this.infoList=res.data
					})
			},
			showPicker() {
				this.$refs.picker.open()
			},
			showPicker1() {
				this.$refs.picker1.open()
			},
			showPicker2() {
				this.$refs.picker2.open()
			},
			confirm(data) {
				console.log(data)
				this.cateName = data.value[0].name
			},
			confirm1(data) {
				console.log(data)
			},
			confirm2(data) {
				console.log(data)
			},
			toMain(i){
				uni.navigateTo({
					url:'/pages/courseDetail/index?id='+i.id
				})
			}


		}





	}
</script>
<style scoped lang="scss">
	page {
		color: #343434;
	}

	.header {
		width: 100%;
		height: 110rpx;
		background-color: #0F7EF2;

		box-sizing: border-box;
		color: #38393B;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		display: flex;

		image {
			width: 42rpx;
		}
	}

	.grid {
		box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
		height: 340rpx;
		font-size: 24rpx;
		color: #343434;

		.griditem {
			width: 25%;
			height: 170rpx;
			display: inline-flex !important;
		}

		image {
			width: 90rpx;
		}
	}

	.lookmore {
		color: #B6B6B6;
		font-size: 24rpx;
		line-height: 24rpx;
	}

	.pxitem {
		box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
		margin-top: 20rpx;
		width: 100%;
		box-sizing: border-box;
		border-radius: 18rpx;
		color: #969696;
		font-size: 24rpx;

		view {
			font-size: 24rpx;
			color: #0082DB;

			// margin: 20rpx 0 30rpx;
		}

		.title {
			font-size: 32rpx;
			font-weight: bold;
		}

		image {
			width: 306rpx;
			height: 236rpx;
			border-radius: 18rpx;
			margin-right: 20rpx;
			flex-shrink: 0;
		}

		.allPeo {
			position: absolute;
			color: #06355B;
			background-color: rgba(255, 219, 109, .95);
			top: 20rpx;
			left: 240rpx;
			margin: 0;
			line-height: 1;
			width: 40rpx;
			text-align: center;
		}

		.start {
			background-color: #E5F2FC;
			color: #0082DB !important;
			font-size: 24rpx;
			text-align: center;
			padding: 4rpx 6rpx;

		}

		.end {
			font-size: 24rpx;
			padding: 4rpx 6rpx;
			color: #F65A58;
			text-align: center;
			background: rgba(246, 90, 88, .1);
		}
	}

	.searchbox {
		background-color: rgba(145, 190, 255, .3);
		border-radius: 12rpx;
		height: 84rpx;
		width: 100%;
		padding: 0 30rpx;
	}

	.moduletitle {
		height: 116rpx;

		text {

			width: 6rpx;
			height: 18rpx;
			background: #0082DB;
			border-radius: .5rem;
			display: block;
		}
	}

	.pickerbox {
		background-color: #fafafa;
		width: 500rpx;
		height: 72rpx;
		color: #969696;
	}

	.tag {
		background-color: rgb(255, 219, 109);
		color: #fff;
		font-size: 26rpx;
		padding: 4rpx 8rpx;
		border-radius: 10rpx;
		margin-right: 10rpx;
	}
		
	.griddata{
		width: 31%;
		    text-align: center;
		    background: #fafafa;
		    padding: 10px 0;
		    margin-bottom: 10px;
			border-radius: 10rpx;
			color: #333;
	}
	.active{
				background-color: #0082DB;
				color: #fff;
	}
	.backOrSave{
		width: 690rpx;
		position: fixed;
		bottom: 120rpx;
		left: 0;
		right: 0;
		margin: auto;
		background-color: #FFFFFF;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0px 30rpx;
		height: 120rpx;
		border-radius: 16rpx;
		.back-box,
		.save-box{
			height: 90rpx;
			width: 300rpx;
			background-color: #e5f2fc;
			border-radius: 16rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			.info-box{
				display: flex;
				justify-content: center;
				align-items: center;
				color: #0484dc;
				font-size: 32rpx;
				image{
					width: 42rpx;
					height: 42rpx;
					margin-right: 24rpx;
				}
			}
			
		}
		.save-box{
			background-color: #5eb5f1;
			.info-box{
				color: #FFFFFF;
			}
		}
	}
</style>